import axios from "axios"
import React, { useEffect, useState } from "react"
import { useParams } from "react-router-dom"
import "./Patient.css"
interface Props {
    _id: string,
    Medical: string
    Card: string,
    Name: string,
    Sex: string,
    Type: string,
    Documents: string,
    Status: string,
    Time: string,
}

const Doctor_xiang: React.FC<Props> = () => {
    const { id } = useParams<{ id: string }>()
    const [list, setlist] = useState<Props[]>([])

    const classlist1 = () => {
        axios.get(`http://127.0.0.1:3000/cws/index_style/?_id=${id}`).then((response) => {
            const { code, data } = response.data
            console.log(data)
            if (code == 200) {
                setlist(data)
            }
        })
    }

    useEffect(() => {
        classlist1()
    }, [])
    return (
        <div>
            <div className="index">
                <div className="index1">
                    <div style={{ marginTop: "15px", float: "left" }}>
                        <span style={{ color: "blue", lineHeight: "20px", float: "left" }}>打印报告</span>

                    </div>
                    {
                        list.map((item, index) => {
                            console.log(item)
                            return <ul key={index} style={{ marginLeft: "800px", marginTop: "20px" }}>
                                <span style={{ lineHeight: "50px" }}>缴费状态：</span> <li style={{ marginLeft: "100px", marginTop: "-35px" }}>{item.Status == "false" ? "已报告" : "未报告"}</li>
                            </ul>
                        })
                    }

                </div>
                <div className="index2">
                    <div className="index3">

                    </div>
                </div>

            </div>

        </div>
    )
}


export default Doctor_xiang